package springboot.demo.controller;

import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import springboot.demo.model.DbTypes;
import springboot.demo.model.Person;

import java.util.Map;

@Controller
public class YmlController {

    @Value("${mykey3}")
    private String mykey3;

    @Value("${mykey4}")
    private Integer mykey4;

    @Value("${aa.bb.cc}")
    private Integer cc;

    @Value("${aa.bb.dd}")
    private Integer dd;

//    @Value("${dbTypes.ball}")
//    private Map<String, String> ball;

    @Autowired
    private Person person;

    @Autowired
    private DbTypes dbTypes;

    @PostConstruct
    public void init(){
        System.out.println("mykey3:" + mykey3);
        System.out.println("cc:" + cc);
        System.out.println("dd:" + dd);
        System.out.println("person: " + person);
        System.out.println("dbTypes: " + dbTypes);
//        System.out.println("ball: " + ball);
    }
}
